import java.util.*;

public class Test {

    public static void main(String[] args) {
        ArrayList<String> list1 = new ArrayList<>();
        list1.add("haha!");
        System.out.println(list1);
        ArrayList<String> list2 = new ArrayList<>(10);
    }

    public static void main6(String[] args) {
        ArrayList<String> list2 = new ArrayList<>();
        list2.add("hello");
        list2.add("bit");
        list2.add("haha");
        System.out.println(list2);
        System.out.println("========");
        for(int i = 0; i< list2.size(); i++){
            System.out.println(list2.get(i) + " ");
        }
        System.out.println();
        System.out.println("========");
        for(String s : list2){
            System.out.print(s + " ");
        }
        System.out.println();
        System.out.println("=============");
        Iterator<String> it = list2.iterator();
        while(it.hasNext()){
            System.out.println(it.next() +" ");
        }
        System.out.println();

        ListIterator<String> it2 = list2.listIterator();
        while(it.hasNext()){
            System.out.println(it2.next() + " ");
        }
    }

    public static void main5(String[] args) {

        List<String> list2 = new ArrayList(20);
        ArrayList<String> list = new ArrayList<>();
        list2.add("hello");
        list.add("bit");
        list.add("haha");
        System.out.println(list2);

        ArrayList<String> list3 = new ArrayList<>(list2);
    }

    public static void main4(String[] args) {
        Integer a = 123;
        Integer b = 123;
        System.out.println(a == b);
    }

    public static void main3(String[] args) {
        Integer a = 123;//装箱
        int b = a;
        System.out.println(a + " "+b);
        System.out.println("=======");

        Integer a2 = Integer.valueOf(123);
        Integer a3 = new Integer(124);

        int b2 = a2.intValue();
        double d = a2.doubleValue();


    }

    public static void main1(String[] args) {
        String str = "123";
        int ret = Integer.valueOf(str);
        System.out.println(ret + 1);
    }

}
